package com.ququ.syb.entrance.controller;

import com.ququ.syb.entrance.po.RequestData;
import com.ququ.syb.entrance.service.PaymentService;
import com.ququ.syb.entrance.vo.SybResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;


/**
 * 支付业务模块
 *
 * @author macro
 * @date 2019-08-26
 *
 */
@RestController
@RequestMapping("/syb/controller")
public class PaymentController {
    @Autowired
    private PaymentService paymentService;


    /**
     * /p0210 创建支付订单
     *
     * @param header.terminalno 终端号，随便填|必填
     * @param header.requesttype 请求类型，默认为1|必填
     * @param header.operationid 请求id|必填
     * @param header.appcode 应用代码|必填
     * @param header.terminaltype 默认填1|必填
     * @param header.timestamp 时间戳|必填
     * @param encryptiontype 加密方式 这里填1-AES|必填
     * @param accountid 生意宝账户|必填
     * @param data 业务数据请求部分，JSON格式，AES加密|必填
     * @param data.orderno 外部订单号|必填
     * @param data.amount 支付金额，单位为分|必填
     * @param data.ordertype 订单类型 0-普通订单 1-担保订单 2-代收订单|必填
     * @param data.title 订单标题|必填
     * @param data.callbackurl 支付回调地址|必填
     * @param data.paychannelid 支付订单号|必填
     * @param data.desc 订单详情
     * @param data.returnurl 网页同步回调地址
     * @param data.withdrawcallbackurl 提现回调地址
     * @param data.payaccountid 付款方账户id
     * @param data.paycommission 付款方手续费，单位为分
     * @param data.payeecommission 收款方手续费，单位为分
     * @param data.assureday 担保天数
     * @param data.timeout 订单超时时间，单位为小时
     * @param data.divideinfo 分账信息，JSON格式，包含字段accountid-分账方账户号和(percent-分账比例(0.25代表25%)或amount-分账金额(单位为分))
     * @param sign 签名
     * @return 支付订单信息
     * @respbody {"status":1,"msg":"成功","data":{"accountid":"100000000064","result":"IiZsinQq4GpNnR1ZZ8TfbIxnMsJAy+rr6/wY56hgPN0ksFZCEs4uBPXezZRmTv5xH0KEbMN9XGvxr0HMncXxBsESnOEUBcUcgkNewGcf3SiPyOv9rkdFV9fjI68tNr27rT3Eotu8jidraJiJKQA2Hj8e8Sh5uxfw2UD1SLuU3+TtDuAM9FbYx0uiF9fEVtl5C1XFRxOjI0Duf94fzK5luk6IoaLHgvOjn+GavprS4AUsk81K5odWgHkP0KscxmV2cfdQmwhzx84UYUQGeEyTZ9Sb11ZBYqKiVOD0TawGi8TEXwjBz+wBkXZ/Hoa96OXc3+jhl2y+0WcpcSULqFYjluXUfCTx6FSMk2yeNk+exKJcYFV+QrVJGZK1QNTsDFNOC/AFsFwAMgGiXkXWJjL3ogcJq8svwjRyMtKx+nkiXlv2+lrrUArU7Gud6VfgiqDE13+BDWfqbs4bGZekgE1Ytk2fB1IcPs2zggbc2M9DWELLoCOQRptopxWsfTjU30nA0ghqAWB3mFxN/1na/DF4ZxWS1H+TOaYT0tOkIVIPFk/ZWjH72MTFpIaSjGOxIpfD"},"page":{"count":1,"index":1,"size":10,"total":1},"sign":"4016c7ba05ff4a8a4ce63f1c5bb7de5e"}
     * @resp status 状态值，1-成功 其他值-失败|int
     * @resp msg 错误信息|string
     * @resp data.accountid 生意宝账号id|string
     * @resp data.result 明文样本 {"amount":100,"appcode":"100004","callbackurl":"http://116.62.37.221:801/api/PayV2/ConfirmPay","costcommission":100,"createaccount":"100000000064","createtime":1566807682000,"description":"测试订单","id":11,"outorderno":"RT20190826161102","paychannelid":"401","paycommission":0,"payeeaccount":"100000000064","payeecommission":0,"status":0,"timeout":1566894081000,"title":"测试订单","tradenum":"P201908260000002","type":2}|string
     * @resp data.result.createaccount 付款方生意宝账号id|string
     * @resp data.result.payeeaccount 收款方(当前)生意宝账户id|string
     * @resp data.result.status 账户状态 1-正常 0-冻结|int
     * @resp data.result.amount 金额，单位为分|int
     * @resp data.result.appcode 应用代码|string
     * @resp data.result.callbackurl 支付回调地址|string
     * @resp data.result.costcommission 成本手续费，单位为分|int
     * @resp data.result.createtime 首次绑卡时间|string
     * @resp data.result.title 订单标题|string
     * @resp data.result.tradenum 生意宝订单号|string
     * @resp data.result.outorderno 商户订单号|string
     * @resp data.result.description 订单详情|string
     * @resp data.result.paycommission 付款方手续费，单位为分|int
     * @resp data.result.payeecommission 收款方手续费，单位为分|int
     * @resp data.result.status 订单状态|int
     * @resp data.result.type 订单类型|int
     * @resp data.result.returnurl 同步回调地址|string
     * @resp page 分页信息，可忽略|object
     */
    @RequestMapping("/p0210")
    public SybResult createPayOrder(@RequestHeader String appcode,
                                    @RequestHeader(required = false) String timeStamp,
                                    @RequestHeader(required = false) String operationid,
                                    @RequestHeader(required = false) String operationname,
                                    @RequestParam String accountid,
                                    @RequestParam String data,
                                    @RequestParam String sign,
                                    @RequestParam Integer encryptiontype){
        RequestData<String> requestData = new RequestData<>(appcode,accountid,operationid,operationname,data,sign,encryptiontype);
        return paymentService.createPayOrder(requestData);
    }




    /**
     * /p0211 执行支付订单支付或发送支付短信
     *
     * @param header.terminalno 终端号，随便填|必填
     * @param header.requesttype 请求类型，默认为1|必填
     * @param header.operationid 请求id|必填
     * @param header.appcode 应用代码|必填
     * @param header.terminaltype 默认填1|必填
     * @param header.timestamp 时间戳|必填
     * @param encryptiontype 加密方式 这里填1-AES|必填
     * @param accountid 生意宝账户|必填
     * @param data 业务数据请求部分，JSON格式，AES加密|必填
     * @param data.tradenum 生意宝订单号|必填
     * @param data.paychannelid 支付通道号|必填
     * @param data.bankaccountname 或name,快捷付款人姓名
     * @param data.bankaccountno 或bankcardno，快捷银行卡号
     * @param data.cardholdermobile 或mobile，快捷银行卡对应的手机号
     * @param data.cardholderidcard 或idcardno，快捷付款人身份证号
     * @param data.expirydate 信用卡有效期，格式为MMYY
     * @param data.cvv2 信用卡CVV2
     * @param data.authcode 条码，微信与支付宝、云闪付的被扫的条码
     * @param data.openid 微信公众号授权的openid
     * @param data.userip 付款人终端IP
     * @param data.buyerid 支付宝付款人id或账号
     * @param data.extparams 特殊通道的扩展参数，JSON格式
     * @param sign 签名
     * @return 支付订单信息
     * @respbody {"status":1,"msg":"成功","data":{"accountid":"100000000064","result":"IiZsinQq4GpNnR1ZZ8TfbIxnMsJAy+rr6/wY56hgPN0ksFZCEs4uBPXezZRmTv5xH0KEbMN9XGvxr0HMncXxBsESnOEUBcUcgkNewGcf3SiPyOv9rkdFV9fjI68tNr27rT3Eotu8jidraJiJKQA2Hj8e8Sh5uxfw2UD1SLuU3+TtDuAM9FbYx0uiF9fEVtl5C1XFRxOjI0Duf94fzK5luk6IoaLHgvOjn+GavprS4AUsk81K5odWgHkP0KscxmV2cfdQmwhzx84UYUQGeEyTZ9Sb11ZBYqKiVOD0TawGi8TEXwjBz+wBkXZ/Hoa96OXc3+jhl2y+0WcpcSULqFYjluXUfCTx6FSMk2yeNk+exKJcYFV+QrVJGZK1QNTsDFNOC/AFsFwAMgGiXkXWJjL3ogcJq8svwjRyMtKx+nkiXlv2+lrrUArU7Gud6VfgiqDE13+BDWfqbs4bGZekgE1Ytk2fB1IcPs2zggbc2M9DWELLoCOQRptopxWsfTjU30nA0ghqAWB3mFxN/1na/DF4ZxWS1H+TOaYT0tOkIVIPFk/ZWjH72MTFpIaSjGOxIpfD"},"page":{"count":1,"index":1,"size":10,"total":1},"sign":"4016c7ba05ff4a8a4ce63f1c5bb7de5e"}
     * @resp status 状态值，1-成功 其他值-失败|int
     * @resp msg 错误信息|string
     * @resp data.accountid 生意宝账号id|string
     * @resp data.result 明文样本 {"accountid":"100000000108","result":{"tradenum":"P201908050000003","payurl":"{\"respDesc\":\"交易成功\",\"orderNo\":\"P201908050000003\",\"productId\":\"0141\",\"exMerId\":\"8883910594412472651703706\",\"signature\":\"fsV0Az7m03JKQm8jZxfhsC+bt06KIaITuORyhkC1ve7Os5R5aUwuhjqQzRyCHrx1iHutlDPvLc6gicZO8ta4jZkFO4tTGJrIe3qjK1SSOU1Z9pyhe3vS0nNpQ2lot3/QO7VT6C3Mjqbcy3XkLOxGjK796kRqA7Gy2r+mtRIfL2khGjxeP3tn/Nkr95IvH+f3RPtTwQm7r8Qv0kI7rv/rwsObYfpwGCWHc8Na2rXvLYfGBn9O7PBwYn6bqLORsC/zvg3ItqIEuvbvZv7ldNayShzZ5mFD/AOm87BH5ml4MRnFYxs/atOs/NLkjXUHbML9x811CJu/J/tYB0hFP8oS5w==\",\"transId\":\"44\",\"requestNo\":\"20190805173021955\",\"version\":\"V1.0\",\"customerName\":\"郭朝阳\",\"expDate\":\"oX857Yl0DUqeIv5KsLDHGA==\",\"phoneNo\":\"13400500817\",\"acctNo\":\"6225760803140339\",\"merNo\":\"888391059441247\",\"cerdType\":\"01\",\"cvn2\":\"fs7bpiHlVJmjcvLtCxlD5w==\",\"cerdId\":\"350583198301063772\",\"orderDate\":\"20190805\",\"respCode\":\"0000\"}","channeltype":1,"paycommission":0,"payeecommission":489}|string
     * @resp data.result.tradenum 生意宝订单号|string
     * @resp data.result.payurl 付款地址或付款信息|string
     * @resp data.result.channeltype 通道类型 1-快捷 3-扫码|int
     * @resp data.result.paycommission 付款方手续费，单位为分|int
     * @resp data.result.payeecommission 收款方手续费，单位为分|int
     * @resp page 分页信息，可忽略|object
     */
    @RequestMapping("/p0211")
    public SybResult paymentOrPaySms(@RequestHeader String appcode,
                                    @RequestHeader(required = false) String timeStamp,
                                    @RequestHeader(required = false) String operationid,
                                    @RequestHeader(required = false) String operationname,
                                    @RequestParam String accountid,
                                    @RequestParam String data,
                                    @RequestParam String sign,
                                    @RequestParam Integer encryptiontype){
        RequestData<String> requestData = new RequestData<>(appcode,accountid,operationid,operationname,data,sign,encryptiontype);
        return paymentService.paymentOrPaySms(requestData);
    }



    /**
     * /p0221 支付订单短信确认
     *
     * @param header.terminalno 终端号，随便填|必填
     * @param header.requesttype 请求类型，默认为1|必填
     * @param header.operationid 请求id|必填
     * @param header.appcode 应用代码|必填
     * @param header.terminaltype 默认填1|必填
     * @param header.timestamp 时间戳|必填
     * @param encryptiontype 加密方式 这里填1-AES|必填
     * @param accountid 生意宝账户|必填
     * @param data 业务数据请求部分，JSON格式，AES加密|必填
     * @param data.tradenum 生意宝订单号|必填
     * @param data.idcode 短信验证码|必填
     * @param sign 签名
     * @return 支付订单信息
     * @respbody {"status":1,"msg":"成功","data":{"accountid":"100000000064","result":"bs4bGZekgE1Ytk2fB1IcPs2zggbc2M9DWELLoCOQRptopxWsfTjU30nA0ghqAWB3mFxN/1na/DF4ZxWS1H+TOaYT0tOkIVIPFk/ZWjH72MTFpIaSjGOxIpfD"},"page":{"count":1,"index":1,"size":10,"total":1},"sign":"4016c7ba05ff4a8a4ce63f1c5bb7de5e"}
     * @resp status 状态值，1-成功 其他值-失败|int
     * @resp msg 错误信息|string
     * @resp data.accountid 生意宝账号id|string
     * @resp data.result 明文样本 {"accountid":"100000000108","result":{"tradenum":"P201908050000003","payurl":"{\"respDesc\":\"交易成功\",\"orderNo\":\"P201908050000003\",\"productId\":\"0141\",\"exMerId\":\"8883910594412472651703706\",\"signature\":\"fsV0Az7m03JKQm8jZxfhsC+bt06KIaITuORyhkC1ve7Os5R5aUwuhjqQzRyCHrx1iHutlDPvLc6gicZO8ta4jZkFO4tTGJrIe3qjK1SSOU1Z9pyhe3vS0nNpQ2lot3/QO7VT6C3Mjqbcy3XkLOxGjK796kRqA7Gy2r+mtRIfL2khGjxeP3tn/Nkr95IvH+f3RPtTwQm7r8Qv0kI7rv/rwsObYfpwGCWHc8Na2rXvLYfGBn9O7PBwYn6bqLORsC/zvg3ItqIEuvbvZv7ldNayShzZ5mFD/AOm87BH5ml4MRnFYxs/atOs/NLkjXUHbML9x811CJu/J/tYB0hFP8oS5w==\",\"transId\":\"44\",\"requestNo\":\"20190805173021955\",\"version\":\"V1.0\",\"customerName\":\"郭朝阳\",\"expDate\":\"oX857Yl0DUqeIv5KsLDHGA==\",\"phoneNo\":\"13400500817\",\"acctNo\":\"6225760803140339\",\"merNo\":\"888391059441247\",\"cerdType\":\"01\",\"cvn2\":\"fs7bpiHlVJmjcvLtCxlD5w==\",\"cerdId\":\"350583198301063772\",\"orderDate\":\"20190805\",\"respCode\":\"0000\"}","channeltype":1,"paycommission":0,"payeecommission":489}|string
     * @resp data.result.tradenum 生意宝订单号|string
     * @resp data.result.payurl 付款地址或付款信息|string
     * @resp data.result.channeltype 通道类型 1-快捷 3-扫码|int
     * @resp data.result.paycommission 付款方手续费，单位为分|int
     * @resp data.result.payeecommission 收款方手续费，单位为分|int
     * @resp page 分页信息，可忽略|object
     */
    @RequestMapping("/p0221")
    public SybResult quickPaySmsConfirm(@RequestHeader String appcode,
                                     @RequestHeader(required = false) String timeStamp,
                                     @RequestHeader(required = false) String operationid,
                                     @RequestHeader(required = false) String operationname,
                                     @RequestParam String accountid,
                                     @RequestParam String data,
                                     @RequestParam String sign,
                                     @RequestParam Integer encryptiontype){
        RequestData<String> requestData = new RequestData<>(appcode,accountid,operationid,operationname,data,sign,encryptiontype);
        return paymentService.quickPaySmsConfirm(requestData);
    }



    /**
     * /p0220 支付订单短信重发
     *
     * @param header.terminalno 终端号，随便填|必填
     * @param header.requesttype 请求类型，默认为1|必填
     * @param header.operationid 请求id|必填
     * @param header.appcode 应用代码|必填
     * @param header.terminaltype 默认填1|必填
     * @param header.timestamp 时间戳|必填
     * @param encryptiontype 加密方式 这里填1-AES|必填
     * @param accountid 生意宝账户|必填
     * @param data 业务数据请求部分，JSON格式，AES加密|必填
     * @param data.tradenum 生意宝订单号|必填
     * @param sign 签名
     * @return 支付订单信息
     * @respbody {"status":1,"msg":"成功","data":{"accountid":"100000000064","result":"bs4bGZekgE1Ytk2fB1IcPs2zggbc2M9DWELLoCOQRptopxWsfTjU30nA0ghqAWB3mFxN/1na/DF4ZxWS1H+TOaYT0tOkIVIPFk/ZWjH72MTFpIaSjGOxIpfD"},"page":{"count":1,"index":1,"size":10,"total":1},"sign":"4016c7ba05ff4a8a4ce63f1c5bb7de5e"}
     * @resp status 状态值，1-成功 其他值-失败|int
     * @resp msg 错误信息|string
     * @resp data.accountid 生意宝账号id|string
     * @resp data.result 明文样本 {"accountid":"100000000108","result":{"tradenum":"P201908050000003","payurl":"{\"respDesc\":\"交易成功\",\"orderNo\":\"P201908050000003\",\"productId\":\"0141\",\"exMerId\":\"8883910594412472651703706\",\"signature\":\"fsV0Az7m03JKQm8jZxfhsC+bt06KIaITuORyhkC1ve7Os5R5aUwuhjqQzRyCHrx1iHutlDPvLc6gicZO8ta4jZkFO4tTGJrIe3qjK1SSOU1Z9pyhe3vS0nNpQ2lot3/QO7VT6C3Mjqbcy3XkLOxGjK796kRqA7Gy2r+mtRIfL2khGjxeP3tn/Nkr95IvH+f3RPtTwQm7r8Qv0kI7rv/rwsObYfpwGCWHc8Na2rXvLYfGBn9O7PBwYn6bqLORsC/zvg3ItqIEuvbvZv7ldNayShzZ5mFD/AOm87BH5ml4MRnFYxs/atOs/NLkjXUHbML9x811CJu/J/tYB0hFP8oS5w==\",\"transId\":\"44\",\"requestNo\":\"20190805173021955\",\"version\":\"V1.0\",\"customerName\":\"郭朝阳\",\"expDate\":\"oX857Yl0DUqeIv5KsLDHGA==\",\"phoneNo\":\"13400500817\",\"acctNo\":\"6225760803140339\",\"merNo\":\"888391059441247\",\"cerdType\":\"01\",\"cvn2\":\"fs7bpiHlVJmjcvLtCxlD5w==\",\"cerdId\":\"350583198301063772\",\"orderDate\":\"20190805\",\"respCode\":\"0000\"}","channeltype":1,"paycommission":0,"payeecommission":489}|string
     * @resp data.result.tradenum 生意宝订单号|string
     * @resp data.result.payurl 付款地址或付款信息|string
     * @resp data.result.channeltype 通道类型 1-快捷 3-扫码|int
     * @resp data.result.paycommission 付款方手续费，单位为分|int
     * @resp data.result.payeecommission 收款方手续费，单位为分|int
     * @resp page 分页信息，可忽略|object
     */
    @RequestMapping("/p0220")
    public SybResult quickPayResendSms(@RequestHeader String appcode,
                                        @RequestHeader(required = false) String timeStamp,
                                        @RequestHeader(required = false) String operationid,
                                        @RequestHeader(required = false) String operationname,
                                        @RequestParam String accountid,
                                        @RequestParam String data,
                                        @RequestParam String sign,
                                        @RequestParam Integer encryptiontype){
        RequestData<String> requestData = new RequestData<>(appcode,accountid,operationid,operationname,data,sign,encryptiontype);
        return paymentService.quickPayResendSms(requestData);
    }


    /**
     * /p0223 担保支付订单确认
     *
     * @param header.terminalno 终端号，随便填|必填
     * @param header.requesttype 请求类型，默认为1|必填
     * @param header.operationid 请求id|必填
     * @param header.appcode 应用代码|必填
     * @param header.terminaltype 默认填1|必填
     * @param header.timestamp 时间戳|必填
     * @param encryptiontype 加密方式 这里填1-AES|必填
     * @param accountid 生意宝账户|必填
     * @param data 业务数据请求部分，JSON格式，AES加密|必填
     * @param data.tradenum 生意宝订单号|必填
     * @param sign 签名
     * @return 支付订单信息
     * @respbody {"status":1,"msg":"成功","data":{"accountid":"100000000064","result":"bs4bGZekgE1Ytk2fB1IcPs2zggbc2M9DWELLoCOQRptopxWsfTjU30nA0ghqAWB3mFxN/1na/DF4ZxWS1H+TOaYT0tOkIVIPFk/ZWjH72MTFpIaSjGOxIpfD"},"page":{"count":1,"index":1,"size":10,"total":1},"sign":"4016c7ba05ff4a8a4ce63f1c5bb7de5e"}
     * @resp status 状态值，1-成功 其他值-失败|int
     * @resp msg 错误信息|string
     * @resp data.accountid 生意宝账号id|string
     * @resp data.result 明文样本 {"accountid":"100000000108","result":{"tradenum":"P201908050000003","payurl":"{\"respDesc\":\"交易成功\",\"orderNo\":\"P201908050000003\",\"productId\":\"0141\",\"exMerId\":\"8883910594412472651703706\",\"signature\":\"fsV0Az7m03JKQm8jZxfhsC+bt06KIaITuORyhkC1ve7Os5R5aUwuhjqQzRyCHrx1iHutlDPvLc6gicZO8ta4jZkFO4tTGJrIe3qjK1SSOU1Z9pyhe3vS0nNpQ2lot3/QO7VT6C3Mjqbcy3XkLOxGjK796kRqA7Gy2r+mtRIfL2khGjxeP3tn/Nkr95IvH+f3RPtTwQm7r8Qv0kI7rv/rwsObYfpwGCWHc8Na2rXvLYfGBn9O7PBwYn6bqLORsC/zvg3ItqIEuvbvZv7ldNayShzZ5mFD/AOm87BH5ml4MRnFYxs/atOs/NLkjXUHbML9x811CJu/J/tYB0hFP8oS5w==\",\"transId\":\"44\",\"requestNo\":\"20190805173021955\",\"version\":\"V1.0\",\"customerName\":\"郭朝阳\",\"expDate\":\"oX857Yl0DUqeIv5KsLDHGA==\",\"phoneNo\":\"13400500817\",\"acctNo\":\"6225760803140339\",\"merNo\":\"888391059441247\",\"cerdType\":\"01\",\"cvn2\":\"fs7bpiHlVJmjcvLtCxlD5w==\",\"cerdId\":\"350583198301063772\",\"orderDate\":\"20190805\",\"respCode\":\"0000\"}","channeltype":1,"paycommission":0,"payeecommission":489}|string
     * @resp data.result.tradenum 生意宝订单号|string
     * @resp data.result.payurl 付款地址或付款信息|string
     * @resp data.result.channeltype 通道类型 1-快捷 3-扫码|int
     * @resp data.result.paycommission 付款方手续费，单位为分|int
     * @resp data.result.payeecommission 收款方手续费，单位为分|int
     * @resp page 分页信息，可忽略|object
     */
    @RequestMapping("/p0223")
    public SybResult paymentAssureConfirm(@RequestHeader String appcode,
                                       @RequestHeader(required = false) String timeStamp,
                                       @RequestHeader(required = false) String operationid,
                                       @RequestHeader(required = false) String operationname,
                                       @RequestParam String accountid,
                                       @RequestParam String data,
                                       @RequestParam String sign,
                                       @RequestParam Integer encryptiontype){
        RequestData<String> requestData = new RequestData<>(appcode,accountid,operationid,operationname,data,sign,encryptiontype);
        return paymentService.paymentAssureConfirm(requestData);
    }


    /**
     * /p0222 支付订单退款
     *
     * @param header.terminalno 终端号，随便填|必填
     * @param header.requesttype 请求类型，默认为1|必填
     * @param header.operationid 请求id|必填
     * @param header.appcode 应用代码|必填
     * @param header.terminaltype 默认填1|必填
     * @param header.timestamp 时间戳|必填
     * @param encryptiontype 加密方式 这里填1-AES|必填
     * @param accountid 生意宝账户|必填
     * @param data 业务数据请求部分，JSON格式，AES加密|必填
     * @param data.tradenum 生意宝订单号|必填
     * @param sign 签名
     * @return 支付订单信息
     * @respbody {"status":1,"msg":"成功","data":{"accountid":"100000000064","result":"bs4bGZekgE1Ytk2fB1IcPs2zggbc2M9DWELLoCOQRptopxWsfTjU30nA0ghqAWB3mFxN/1na/DF4ZxWS1H+TOaYT0tOkIVIPFk/ZWjH72MTFpIaSjGOxIpfD"},"page":{"count":1,"index":1,"size":10,"total":1},"sign":"4016c7ba05ff4a8a4ce63f1c5bb7de5e"}
     * @resp status 状态值，1-成功 其他值-失败|int
     * @resp msg 错误信息|string
     * @resp data.accountid 生意宝账号id|string
     * @resp data.result 明文样本 {"accountid":"100000000108","result":{"tradenum":"P201908050000003","payurl":"{\"respDesc\":\"交易成功\",\"orderNo\":\"P201908050000003\",\"productId\":\"0141\",\"exMerId\":\"8883910594412472651703706\",\"signature\":\"fsV0Az7m03JKQm8jZxfhsC+bt06KIaITuORyhkC1ve7Os5R5aUwuhjqQzRyCHrx1iHutlDPvLc6gicZO8ta4jZkFO4tTGJrIe3qjK1SSOU1Z9pyhe3vS0nNpQ2lot3/QO7VT6C3Mjqbcy3XkLOxGjK796kRqA7Gy2r+mtRIfL2khGjxeP3tn/Nkr95IvH+f3RPtTwQm7r8Qv0kI7rv/rwsObYfpwGCWHc8Na2rXvLYfGBn9O7PBwYn6bqLORsC/zvg3ItqIEuvbvZv7ldNayShzZ5mFD/AOm87BH5ml4MRnFYxs/atOs/NLkjXUHbML9x811CJu/J/tYB0hFP8oS5w==\",\"transId\":\"44\",\"requestNo\":\"20190805173021955\",\"version\":\"V1.0\",\"customerName\":\"郭朝阳\",\"expDate\":\"oX857Yl0DUqeIv5KsLDHGA==\",\"phoneNo\":\"13400500817\",\"acctNo\":\"6225760803140339\",\"merNo\":\"888391059441247\",\"cerdType\":\"01\",\"cvn2\":\"fs7bpiHlVJmjcvLtCxlD5w==\",\"cerdId\":\"350583198301063772\",\"orderDate\":\"20190805\",\"respCode\":\"0000\"}","channeltype":1,"paycommission":0,"payeecommission":489}|string
     * @resp data.result.tradenum 生意宝订单号|string
     * @resp data.result.payurl 付款地址或付款信息|string
     * @resp data.result.channeltype 通道类型 1-快捷 3-扫码|int
     * @resp data.result.paycommission 付款方手续费，单位为分|int
     * @resp data.result.payeecommission 收款方手续费，单位为分|int
     * @resp page 分页信息，可忽略|object
     */
    @RequestMapping("/p0222")
    public SybResult paymentRefund(@RequestHeader String appcode,
                                       @RequestHeader(required = false) String timeStamp,
                                       @RequestHeader(required = false) String operationid,
                                       @RequestHeader(required = false) String operationname,
                                       @RequestParam String accountid,
                                       @RequestParam String data,
                                       @RequestParam String sign,
                                       @RequestParam Integer encryptiontype){
        RequestData<String> requestData = new RequestData<>(appcode,accountid,operationid,operationname,data,sign,encryptiontype);
        return paymentService.paymentRefund(requestData);
    }


}
